//
// Created by tim on 2021/10/8.
//

#ifndef BJUT_CPP_2_EMPLOYEE_H
#define BJUT_CPP_2_EMPLOYEE_H

class employee
{
	protected:
		std::string id;
		std::string name;
		int salary;
		virtual void count() = 0;

	public:
		employee(): id(""), name(""), salary(0) {};
		employee(std::string _id, std::string _name):
			id(_id), name(_name), salary(0) {}
		int get_salary()
		{
			if (salary == 0) count();
			return salary;
		}
		void set_salary(int new_salary)
		{
			salary = new_salary;
		}
		std::string get_id() const { return id; }
		std::string get_name() const { return name; }
};

#endif //BJUT_CPP_2_EMPLOYEE_H
